package com.briup.jz.service.impl;

import com.briup.jz.bean.BaseFile;
import com.briup.jz.bean.BaseFileExample;
import com.briup.jz.bean.CertificationApply;
import com.briup.jz.dao.CertificationApplyMapper;
import com.briup.jz.service.ICertificationApplyService;
import com.briup.jz.utils.CustomerException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CertificationApplyServiceImpl implements ICertificationApplyService {

    //依赖注入
    @Resource
    private CertificationApplyMapper certificationApplyMapper;

    @Override
    public void saveOrUpdat(CertificationApply certificationApply) throws CustomerException {

        if (certificationApply.getId()!=null){
            //更新操作
            certificationApplyMapper.updateByPrimaryKey(certificationApply);
        }else {
            certificationApplyMapper.insert(certificationApply);
        }
    }

    @Override
    public CertificationApply query(Long id) {
        return  certificationApplyMapper.selectByPrimaryKey(id);
    }

    @Override
    public void deleteById(Long id) throws CustomerException {

        certificationApplyMapper.deleteByPrimaryKey(id);
    }
}
